<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Russian Dolls for the Maximum Stable Set Problem: graph/bitmap.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Russian Dolls for the Maximum Stable Set Problem
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">bitmap.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="bitmap_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#ifndef BITMAP_H_</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BITMAP_H_</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#ifdef _DEBUG_</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#ifdef _ARCH32_  // see comments at #ifdef _ARCH8_</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a>;     </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#define BSIZE 32                                        </span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define WSIZE 4                                         </span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#define LOGB 5L                                         </span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#define LOGW 2L                                         </span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define LOGBW 7L                                        </span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define ONE 1L                                          </span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#define NODEMAX 0xFFFFFFFF                      </span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#define MASKB 0x1FL                                     </span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">//#define MASKB 0xFFFFFFE0</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#define MASKSZ 33                                       </span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">static const NODETYPE __mask[MASKSZ] = {</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor"></span>                0xFFFFFFFF,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;                0xFFFFFFFE, 0xFFFFFFFC, 0xFFFFFFF8, 0xFFFFFFF0,</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;                0xFFFFFFE0, 0xFFFFFFC0, 0xFFFFFF80, 0xFFFFFF00,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;                0xFFFFFE00, 0xFFFFFC00, 0xFFFFF800, 0xFFFFF000,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                0xFFFFE000, 0xFFFFC000, 0xFFFF8000, 0xFFFF0000,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                0xFFFE0000, 0xFFFC0000, 0xFFF80000, 0xFFF00000,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                0xFFE00000, 0xFFC00000, 0xFF800000, 0xFF000000,</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                0xFE000000, 0xFC000000, 0xF8000000, 0xF0000000,</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;                0xE0000000, 0xC0000000, 0x80000000, 0x00000000</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#define NODECOUNTER(i) __builtin_popcountl(i)</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODELEAST(w) (__builtin_ffsl(w)-1)</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODENEXTLEAST(w, i) (__builtin_ffsl(w &amp; __mask[i + 1])-1)</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODEMOST(i) (BSIZE-__builtin_clzl(i)-1)</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODEPREVMOST(w, i) (BSIZE-__builtin_clzl(w &amp; ~__mask[i])-1)</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#elif _ARCH64_</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a>;        </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#define BSIZE 64</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WSIZE 8</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define LOGB 6LL</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define LOGW 3</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define LOGBW 9</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#define ONE 1LL</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODEMAX 0xFFFFFFFFFFFFFFFF</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define MASKB 0x3FLL</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor"></span><span class="comment">//#define MASKB 0xFFFFFFFFFFFFFFC0</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#define MASKSZ 65</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> __mask[<a class="code" href="bitmap_8h.html#ad1979fd3808c70cc2eaf720ec1816a21" title="Number of elements in __mask.">MASKSZ</a>] = {</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                0xFFFFFFFFFFFFFFFF,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFC, 0xFFFFFFFFFFFFFFF8, 0xFFFFFFFFFFFFFFF0,</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                0xFFFFFFFFFFFFFFE0, 0xFFFFFFFFFFFFFFC0, 0xFFFFFFFFFFFFFF80, 0xFFFFFFFFFFFFFF00,</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                0xFFFFFFFFFFFFFE00, 0xFFFFFFFFFFFFFC00, 0xFFFFFFFFFFFFF800, 0xFFFFFFFFFFFFF000,</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                0xFFFFFFFFFFFFE000, 0xFFFFFFFFFFFFC000, 0xFFFFFFFFFFFF8000, 0xFFFFFFFFFFFF0000,</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                0xFFFFFFFFFFFE0000, 0xFFFFFFFFFFFC0000, 0xFFFFFFFFFFF80000, 0xFFFFFFFFFFF00000,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;                0xFFFFFFFFFFE00000, 0xFFFFFFFFFFC00000, 0xFFFFFFFFFF800000, 0xFFFFFFFFFF000000,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                0xFFFFFFFFFE000000, 0xFFFFFFFFFC000000, 0xFFFFFFFFF8000000, 0xFFFFFFFFF0000000,</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;                0xFFFFFFFFE0000000, 0xFFFFFFFFC0000000, 0xFFFFFFFF80000000, 0xFFFFFFFF00000000,</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                0xFFFFFFFE00000000, 0xFFFFFFFC00000000, 0xFFFFFFF800000000, 0xFFFFFFF000000000,</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                0xFFFFFFE000000000, 0xFFFFFFC000000000, 0xFFFFFF8000000000, 0xFFFFFF0000000000,</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                0xFFFFFE0000000000, 0xFFFFFC0000000000, 0xFFFFF80000000000, 0xFFFFF00000000000,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                0xFFFFE00000000000, 0xFFFFC00000000000, 0xFFFF800000000000, 0xFFFF000000000000,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                0xFFFE000000000000, 0xFFFC000000000000, 0xFFF8000000000000, 0xFFF0000000000000,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                0xFFE0000000000000, 0xFFC0000000000000, 0xFF80000000000000, 0xFF00000000000000,</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                0xFE00000000000000, 0xFC00000000000000, 0xF800000000000000, 0xF000000000000000,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                0xE000000000000000, 0xC000000000000000, 0x8000000000000000, 0x0000000000000000</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;};</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#define NODECOUNTER(i) __builtin_popcountll(i)</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODELEAST(w) (__builtin_ffsll(w)-1)</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODENEXTLEAST(w, i) (__builtin_ffsll(w &amp; __mask[i + 1])-1)</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODEMOST(i) (BSIZE-__builtin_clzll(i)-1)</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NODEPREVMOST(w, i) (BSIZE-__builtin_clzll(w &amp; ~__mask[i])-1)</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a">  104</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a>;                     </div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a403cf3149c084cea115b85c90721039a">  105</a></span>&#160;<span class="preprocessor">#define BSIZE 8                                                         </span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a7edb6b8a8c89cb564d6e1b85ed80e7db">  106</a></span>&#160;<span class="preprocessor">#define WSIZE 1                                                         </span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="bitmap_8h.html#afced88f944530b6dfb95807ae45120a6">  107</a></span>&#160;<span class="preprocessor">#define LOGB 3                                                          </span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="bitmap_8h.html#ac6f0b43ab85743ce5de50d53bda6de62">  108</a></span>&#160;<span class="preprocessor">#define LOGW 0                                                          </span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="bitmap_8h.html#adaab21e44ecc67f293c370259571617c">  109</a></span>&#160;<span class="preprocessor">#define LOGBW 3                                                         </span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a206b6f5362e56b51ca957635350b70b6">  111</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define ONE 1                                                           </span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="bitmap_8h.html#af7ff4ea4784ba1f3d083f292fa8858a5">  112</a></span>&#160;<span class="preprocessor">#define NODEMAX 0xFF                                            </span></div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a44f677bb805ccf52a98b641df22ad839">  113</a></span>&#160;<span class="preprocessor">#define MASKB 0x07                                                      </span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">//#define MASKB 0xFFFFFFE0</span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="code" href="bitmap_8h.html#ad1979fd3808c70cc2eaf720ec1816a21">  116</a></span>&#160;<span class="preprocessor">#define MASKSZ 9                                                        </span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="preprocessor">static const NODETYPE __mask[MASKSZ] = {        </span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">                0xFF,</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor"></span>                0xFE, 0xFC, 0xF8, 0xF0,</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                0xE0, 0xC0, 0x80, 0x00</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;};</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="bitmap_8h.html#aebeb87d7e27e1bd467b131d39e26a550">  123</a></span>&#160;<span class="preprocessor">#define NODECOUNTER(w) __builtin_popcount(w)                                            </span></div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="bitmap_8h.html#afc75c90250f604f7b39bd95b31065060">  124</a></span>&#160;<span class="preprocessor">#define NODELEAST(w) (__builtin_ffs(w)-1)                                                       </span></div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a221a194080aa8915012589aad1242b0f">  125</a></span>&#160;<span class="preprocessor">#define NODENEXTLEAST(w, i) (__builtin_ffs(w &amp; __mask[i + 1])-1)        </span></div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a2d04be6fd312695e90eaf4c44d59c8fd">  126</a></span>&#160;<span class="preprocessor">#define NODEMOST(i) (BSIZE-__builtin_clz(i)-1)                                          </span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a40516649a3771e319c376d4ca991cd3d">  127</a></span>&#160;<span class="preprocessor">#define NODEPREVMOST(w, i) (BSIZE-__builtin_clz(w &amp; ~__mask[i])-1)      </span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a4642ff745cdc525c7566b436f452e33f">  131</a></span>&#160;<span class="preprocessor">#define NELEM(i) ((i) &lt;&lt; LOGB)                                                          </span></div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="bitmap_8h.html#ab8ce022c2df6a106a810279b8fa255fb">  132</a></span>&#160;<span class="preprocessor">#define NODEIDX(i) ((i) &gt;&gt; LOGB)                                                        </span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a38e54c56fc0272a1b9d42ba71935bb25">  133</a></span>&#160;<span class="preprocessor">#define IDXINNODE(i) ((i) &amp; MASKB)                                                      </span></div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a14fc6dc47eef5bf11c7f0cc62d5810be">  134</a></span>&#160;<span class="preprocessor">#define ISINNODE(w, i) ((w) &amp; (ONE &lt;&lt; (i)))                                     </span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a30192306152a036a64b05241e9efa9dc">  135</a></span>&#160;<span class="preprocessor">#define ISINSET(T, i) ISINNODE(T[NODEIDX(i)], IDXINNODE(i))     </span></div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="code" href="bitmap_8h.html#ab49b1a17c43250b876e6ff5f0afb03c3">  136</a></span>&#160;<span class="preprocessor">#define DELFROMNODE(w, i) ((w) &amp; ~(ONE &lt;&lt; (i)))                         </span></div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="bitmap_8h.html#a0eb72bff3ce11daf1a05821253a8c649">  137</a></span>&#160;<span class="preprocessor">#define ADDTONODE(w, i) ((w) | (ONE &lt;&lt; (i)))                            </span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="bitmap_8h.html#af41c5c0abda248b11f69efd096a1e608">  138</a></span>&#160;<span class="preprocessor">#define ADDALL(R, n) memset(R, 0xFF, ((n) &lt;&lt; LOGW))                     </span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="bitmap_8h.html#adec2f6c1d7052166719b2563964c74fd">  139</a></span>&#160;<span class="preprocessor">#define DELALL(R, n) memset(R, 0, ((n) &lt;&lt; LOGW))                        </span></div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="bitmap_8h.html#ad0810fd203c326b7b5d6d655b5b62d69">  140</a></span>&#160;<span class="preprocessor">#define COPYALL(R, S, n) memcpy(R, S, ((n) &lt;&lt; LOGW))            </span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="comment">//int cardOfSet(NODETYPE * bmvec, int from, int to);</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> cardOfSet(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="keywordtype">int</span> node, ret = 0;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                ret += <a class="code" href="bitmap_8h.html#aebeb87d7e27e1bd467b131d39e26a550" title="Builtin function: Returns the number of 1-bits in w.">NODECOUNTER</a>(bmvec[node]);</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;}</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">//static void copyAll(NODETYPE * bmvec, NODETYPE * abmvec, int from, int to);</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> copyAll(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * abmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;                bmvec[node] = abmvec[node];</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;}</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment">//static void   addAll(NODETYPE * bmvec, NODETYPE * abmvec, int from, int to);</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span>      addAll(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * abmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                bmvec[node] |= abmvec[node];</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;}</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="comment">//static void removeAll(NODETYPE * bmvec, NODETYPE * rbmvec, int from, int to);</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> removeAll(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * rbmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                bmvec[node] &amp;= ~rbmvec[node];</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;}</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">//static void retainAll(NODETYPE * bmvec, NODETYPE * rbmvec, int from, int to);</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> retainAll(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * rbmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                bmvec[node] &amp;= rbmvec[node];</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;}</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;<span class="comment">//static void intersectOf(NODETYPE * bmvec, NODETYPE * abmvec, NODETYPE * bbmvec, int from, int to);</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> intersectOf(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * abmvec, <a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bbmvec, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;        <span class="keywordflow">for</span> (node = from; node &lt; to; node++)</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                bmvec[node] = abmvec[node] &amp; bbmvec[node];</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;}</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="comment">//static int minNode(NODETYPE * bm, int i, size_t nnodes);</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> minNode(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bm, <span class="keywordtype">int</span> i, <span class="keywordtype">size_t</span> nnodes) {</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="keywordflow">while</span> (!bm[i] &amp;&amp; i &lt; nnodes)</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;                i++;</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordflow">return</span> i;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;}</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;<span class="comment">//static int maxNode(NODETYPE * bm, int i, int mini);</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> maxNode(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * bm, <span class="keywordtype">int</span> i, <span class="keywordtype">int</span> mini) {</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        <span class="keywordflow">while</span> (!bm[i] &amp;&amp; i &gt;= mini)</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;                i--;</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;        <span class="keywordflow">return</span> i;</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;}</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;<span class="preprocessor">#ifdef _DEBUG_</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;<span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> printSetNodes(<a class="code" href="bitmap_8h.html#a5047cbfad0b49c9f1c7a57ddbee2009a" title="Bitmap node&#39;s type.">NODETYPE</a> * s, <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to) {</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        <span class="keywordtype">int</span> node;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;<span class="preprocessor">#ifdef _ARCH32_</span></div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FORMX &quot; %lx&quot;</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#elif _ARCH64_</span></div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FORMX &quot; %llx&quot;</span></div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#else</span></div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FORMX &quot; %x&quot;</span></div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        printf(<span class="stringliteral">&quot;SET: [&quot;</span>);</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        <span class="keywordflow">for</span> (node = to-1; node &gt;= from; node--)</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                printf(FORMX, s[node]);</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        printf(<span class="stringliteral">&quot;]\n&quot;</span>);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;}</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* BITMAP_H_ */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 14 2014 13:23:35 for Russian Dolls for the Maximum Stable Set Problem by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
